package com.haoze.nurseapp.dao;

import com.haoze.common.mapper.MyMapper;
import com.haoze.common.model.TaskExecuteBatchEntity;
import com.haoze.nurseapp.dto.oral.OralMedicineListDTO;
import com.haoze.nurseapp.model.OralDrugReturnEntity;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OralMedicineMapper extends MyMapper<OralDrugReturnEntity> {

    List<Map<String,String>> getMedicineList(@Param("wardId") String wardId,@Param("print") String print, @Param("keyWord") String keyWord,
                                             @Param("date") String date,@Param("formatDate") String formatDate,@Param("inpatNum") List<String> inpatNum,@Param("freqData") String freqData);

    List<String> getTimeList(@Param("inpatList") String[] inpatList, @Param("executeTime") Date executeTime, @Param("time") String time, @Param("keyWord") String keyWord, @Param("print") String print);

    List<String> getFreqList(@Param("wardId") String wardId,@Param("inpatNum") String inpatNum,@Param("value") String value);

    List<Map<String,String>> getInpatList(@Param("wardId") String wardId,@Param("print") String print, @Param("keyWord") String keyWord,
                                          @Param("date") String date,@Param("formatDate") String formatDate,@Param("inpatNum") List<String> inpatNum,@Param("freqData") String freqData);

    List<Map<String,String>> getPrintMarkList(@Param("qrTime") String qrTime,@Param("inpatNum") String inpatNum,@Param("freqTime") String freqTime);

    List<Map<String,String>> getWardPatientList(@Param("wardId") String wardId,@Param("keyWord") String keyWord);

    Map<String,String> getTurnBackByQrcode(@Param("qrCode") String qrCode);

    List<Map<String,String>> getRelationList(@Param("qrTime") String qrTime,@Param("freqTime") String freqTime, @Param("wardDeptId") String wardDeptId,
                                             @Param("keyWord") String keyWord,@Param("qrCode") String qrCode,@Param("nodeId") String nodeId,@Param("turnBackFlag") String turnBackFlag
            ,@Param("inpatNum") String inpatNum);

    List<Map<String,String>> getReturnList(@Param("wardId") String wardId, @Param("returnTime") String returnTime,@Param("keyWord") String keyWord,@Param("type") String type);
    List<Map<String,String>> getReturnListByInpatNum(@Param("wardId") String wardId,@Param("inpatNum") String inpatNum, @Param("returnTime") String returnTime,@Param("keyWord") String keyWord,@Param("type") String type);

    List<String> getReturnItems(@Param("wardId") String wardId,@Param("freqTime") String freqTime, @Param("returnTime") String returnTime,@Param("keyWord") String keyWord);

    List<Map<String,String>> getReturnDetail(@Param("wardId") String wardId,@Param("qrCode") String qrCode, @Param("ids") List<String> ids);

//    void updateRelation(@Param("qrCode") String qrCode,@Param("ids") List<String> ids);
//
//    void updateNotInRelation(@Param("qrCode") String qrCode,@Param("ids") List<String> ids);

    Map<String,Object> getFreqById(@Param("freqId") String freqId);

    Map<String,String> getTaskBatch(@Param("inpatOrderDataId") String inpatOrderDataId,@Param("date") String date,@Param("inpatNum") String inpatNum);

    List<TaskExecuteBatchEntity> getBatchByQrCode(@Param("qrCodeList") List<String> qrCodeList);

    List<Map<String,String>> getOrdersByIds(@Param("idList") List<String> idList);

    void updateOralFile(@Param("dataValue") String dataValue,@Param("dataCode") String dataCode,@Param("emrFileId") String emrFileId);

    List<OralMedicineListDTO> selectOralByInpats(@Param("inpatList") String[] inpatList, @Param("executeTime") Date executeTime, @Param("time") String time, @Param("keyWord") String keyWord, @Param("print") String print,@Param("machineSign") String machineSign,@Param("ordersClass") String ordersClass);

    List<String> getQrcodesByOralCode(@Param("qrCode") String qrCode,@Param("nodeId") String nodeId,@Param("orderList") List<String> orderList);

    String selectPrintFlag(@Param("inpatNum") String inpatNum, @Param("orderNo") String orderNo, @Param("freqData") String freqData);

    List<OralMedicineListDTO> selectOralByInpatsByApp(@Param("inpatList") String[] inpatList, @Param("executeTime") Date executeTime, @Param("time") String time, @Param("keyWord") String keyWord
            , @Param("print") String print, @Param("wardId") String wardId);

    String selectPrintFlagByApp(@Param("inpatNum") String inpatNum, @Param("orderNo") String orderNo, @Param("freqData") String freqData);

    String getFileByTaskDetailId(@Param("detailId") String detailId);

    String getNewestNode(@Param("qrCodeList") List<String> qrCodeList,@Param("oralCode") String oralCode);

    String getTermination(@Param("orderId") String orderId);

    String checkTermination(@Param("inpatNum") String inpatNum,@Param("orderId") String orderId,@Param("date") String date,@Param("freqTime") String freqTime);

    String selectPrintFlagOne(@Param("date") String date,@Param("inpatNum") String inpatNum,@Param("orderNo") String orderNo,@Param("freqData") String freqData);

    String selectPrintFlagPrint(@Param("date") String date,@Param("qrCode") String qrCode,@Param("orderNo") String orderNo);//a
}



